<?php
error_reporting("E_ALL");ini_set("display_errors", 1);
$getdata=$_REQUEST;
if(empty($getdata))$getdata=$_POST?$_POST:$_GET;
$type=empty($getdata['type'])?'':$getdata['type'];
include("include/function.php");
//header("content-Type: application/json; charset=utf-8");
$config = include("config.php");
include("include/".$config['DB_TYPE'].".class.php");
$db = new db;
$db->connect($config['DB_HOST'],$config['DB_USER'],$config['DB_PWD'],$config['DB_NAME'], $config['DB_PCONNECT']);
  
$sql = "select school_id,name,uuid from hema_school where status=1 and uuid<>''";
$list = $db->get_all($sql);
$class=[];
foreach($list as $v){
   /* $sql = "select unitid from order_info where unitName='".$v['name']."' and unitid<>''";
    $info = $db->get_one($sql);
    if(!empty($info['unitid'])){
        $db->query("update hema_school set uuid='".$info['unitid']."' where school_id=".$v['school_id']);
    }*/
   $db->query("update hema_school_class set school_uuid='".$v['uuid']."' where school_id=".$v['school_id']);  
}

//echo count($sqlarr)."\n";
//echo implode(";\n",$sqlarr);
?>